// import './assets/main.css'
import * as icons from '@element-plus/icons-vue';
import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import zhCn from 'element-plus/dist/locale/zh-cn'; // 中文语言包

import App from '@/App.vue';
import router from '@/router';

// // 修复 touch 事件 passive 警告
// const originalAdd = EventTarget.prototype.addEventListener;
// EventTarget.prototype.addEventListener = function (type, listener, options) {
//     if (type === 'touchstart' || type === 'touchmove') {
//         const opts =
//             typeof options === 'object'
//                 ? { ...options, passive: !options.nonPassive }
//                 : { passive: true };
//         return originalAdd.call(this, type, listener, opts);
//     }
//     return originalAdd.call(this, type, listener, options);
// };

const app = createApp(App)

app.use(ElementPlus, {
    locale: zhCn, // 全局中文化
})

Object.entries(icons).forEach(([key, icon]) => {
    app.component(key, icon)
})

app.use(router)





app.mount('#app')